<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="DocumentoCreateDlgE" widgetVar="DocumentoCreateDialogE" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.CreateDocumentoTitle}">
            <h:form id="DocumentoCreateFormE">
                <h:panelGroup id="displayE">
                    <p:panelGrid columns="2" rendered="#{documentoController.selected != null}">
                        <p:outputLabel value="#{bundle.CreateDocumentoLabel_fecDoc}" for="fecDoc" />
                        <p:calendar id="fecDoc" pattern="MM/dd/yyyy HH:mm:ss" value="#{documentoController.selected.fecDoc}" title="#{bundle.EditDocumentoTitle_fecDoc}" required="true" requiredMessage="#{bundle.EditDocumentoTitle_fecDoc}" showOn="button"/>
                        <p:outputLabel value="#{bundle.CreateDocumentoLabel_valorDoc}" for="valorDoc" />
                        <p:inputText id="valorDoc" value="#{documentoController.selected.valorDoc}" title="#{bundle.CreateDocumentoTitle_valorDoc}" />
                        <p:outputLabel value="#{bundle.CreateDocumentoLabel_anuladoDoc}" for="anuladoDoc" />
                        <p:selectBooleanCheckbox id="anuladoDoc" value="#{documentoController.selected.anuladoDoc}" required="true" requiredMessage="#{bundle.EditDocumentoRequiredMessage_anuladoDoc}"/>
                        <p:outputLabel value="#{bundle.CreateDocumentoLabel_notaDoc}" for="notaDoc" />
                        <p:inputText id="notaDoc" value="#{documentoController.selected.notaDoc}" title="#{bundle.CreateDocumentoTitle_notaDoc}" required="true" requiredMessage="#{bundle.CreateDocumentoRequiredMessage_notaDoc}"/>
                        <p:outputLabel value="#{bundle.CreateDocumentoLabel_consecutivoDoc}" for="consecutivoDoc" />
                        <p:inputText id="consecutivoDoc" value="#{documentoController.selected.consecutivoDoc}" title="#{bundle.CreateDocumentoTitle_consecutivoDoc}" />
                        <p:outputLabel value="#{bundle.CreateDocumentoLabel_idTipoDocumento}" for="idTipoDocumento" />
                        <p:selectOneMenu id="idTipoDocumento" value="#{documentoController.selected.idTipoDocumento}" >
                            <f:selectItems value="#{tipoDocumentoController.itemsAvailableSelectOne}"
                                           var="idTipoDocumentoItem"
                                           itemValue="#{idTipoDocumentoItem}"
                                           itemLabel="#{idTipoDocumentoItem.nombreDoc}"/>
                        </p:selectOneMenu>
                        <p:outputLabel value="#{bundle.CreateDocumentoLabel_idCliente}" for="idCliente" />
                        <p:selectOneMenu id="idCliente" value="#{documentoController.selected.idCliente}" >
                            <f:selectItems value="#{clienteController.itemsAvailableSelectOne}"
                                           var="idClienteItem"
                                           itemValue="#{idClienteItem}"
                                           itemLabel="#{idClienteItem.nombre} #{idClienteItem.apellido}"/>
                        </p:selectOneMenu>
                        <p:outputLabel value="#{bundle.CreateDocumentoLabel_idTipoDinero}" for="idTipoDinero" />
                        <p:selectOneMenu id="idTipoDinero" value="#{documentoController.selected.idTipoDinero}" >
                            <f:selectItems value="#{tipoDineroController.itemsAvailableSelectOne}"
                                           var="idTipoDineroItem"
                                           itemValue="#{idTipoDineroItem}"
                                           itemLabel="#{idTipoDineroItem.nombreTipoDinero}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{documentoController.create}" value="#{bundle.Save}" update="displayE,:DocumentoListForm:tabs:datalistE,:growl" oncomplete="handleSubmit(args,'DocumentoCreateDialogE');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="DocumentoCreateDialogE.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
